#include<cstdio>
#include<easyx.h>
#include<iostream>
#include<cmath>
using namespace std;
#define PI 3.1415926535897932384626433832795
void fiveStar(int r, double startAngle) {
    double d = 2 * PI / 5;
    POINT point[5];
    for (int i = 0; i < 5; i++){
        point[i].x = cos(startAngle + i * d * 2) * r;
        point[i].y = sin(startAngle + i * d * 2) * r;
    }
    solidpolygon(point, 5);
}
int main(){
    int width = 900, height = width / 3 * 2;
    int grid = width / 2 / 15;
    initgraph(width, height);
    setbkcolor(RED);
    cleardevice();
    setaspectratio(1, -1);
    setfillcolor(YELLOW);
    setpolyfillmode(WINDING);
    double g[5][2] = {5,5,10,2,12,4,12,7,10,9};
    double b[5] = {PI / 2,atan(3.0 / 5.0) + PI,atan(1.0 / 7.0) + PI,-atan(2.0 / 7.0) + PI ,-atan(4.0 / 5.0) + PI};
    for (int i = 0; i < 5; ++i) {
        setorigin(grid * g[i][0], grid * g[i][1]);
        fiveStar(grid*(i==0?3:1), b[i]);
    }
    system("pause");
    closegraph();
    return 0;
}

